#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("color.in","r",stdin);
	freopen("color.out","w",stdout);
	int t;
	cin>>t;
	while(t--){
		int n;
		int a[1000005];
		int b[1000005]={0};
		cin>>n;
		int z=0;
		for(int i=1;i<=n;i++){
			cin>>a[i];
			b[a[i]]++;
			if(b[a[i]]>=2)z=1;
		}
		if(z==0){
			cout<<0<<endl;
		}
		else{
			cout<<1<<endl;
		}
	}
	return 0;
}
